

$leftToRightColors:#ff0a78,#2c0b8e,#4433ff,#d90429,#57cc99,#ffd819,#adb5bd,#495057,#212529;

@mixin buttons-generator-sliding-left-to-right--common($bgC) {
  min-width: 130px;
  height: 40px;
  color: #fff;
  padding: 5px 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
  outline: none;
  border-radius: 5px;
  z-index: 0;
  background: #fff;
  overflow: hidden;
  border: 2px solid $bgC;
  color: $bgC;
  &:hover {
    color: #fff;
  }
  &:hover:after {
    width: 100%;
  }
  &:after {
    content: "";
    position: absolute;
    z-index: -1;
    transition: all 0.3s ease;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: $bgC;
  }
}

@for $i from 1 through length($leftToRightColors){
    .buttons-generator-sliding-left-to-right--#{$i} {
        @include buttons-generator-sliding-left-to-right--common(
            nth($leftToRightColors,$i)
        )
    }
}



